package pl.krzosekm.vehicleregister.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import pl.krzosekm.vehicleregister.dao.UserDAO;
import pl.krzosekm.vehicleregister.model.User;


@Transactional(propagation = Propagation.REQUIRED)
public class UserServiceImpl extends BaseService implements UserService {

	@Autowired
	UserDAO userDAO;
	
	public void saveUser(User user)
	{
		userDAO.save(user);
	}
	
	public List<User> findAllUsers()
	{
		List<User> userslist = userDAO.findAllUsers();
		return userslist;
	}

	
	
	public UserDAO getUserDAO() {
	    return userDAO;
	}

	public void setUserDAO(UserDAO userDAO) {
	    this.userDAO = userDAO;
	}
	

	
	
}
